/*
 * Copyright 2002-2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.aop.aspectj;

import org.springframework.core.Ordered;

/**
 * 接口，由能够提供该信息的类型实现需要按照AspectJ的优先规则对建议/建议进行排序。
 *
 * @author Adrian Colyer
 * @since 2.0
 * @see org.springframework.aop.aspectj.autoproxy.AspectJPrecedenceComparator
 */
public interface AspectJPrecedenceInformation extends Ordered {

	// 实现注意:
	// 我们需要这个接口提供的间接级别，否则AspectJPrecedenceComparator在所有情况下都必须向Advisor请求Advice，
	// 以便对Advisor进行排序。
	// 这将导致InstantiationModelAwarePointcutAdvisor出现问题，它需要延迟为非单例实例化模型的方面创建通知。

	/**
	 * 返回声明advice的aspect(bean)的名称。
	 */
	String getAspectName();

	/**
	 * 返回方面中通知成员的声明顺序。
	 */
	int getDeclarationOrder();

	/**
	 * 返回是否为before advice.
	 */
	boolean isBeforeAdvice();

	/**
	 * 返回是否为after advice。
	 */
	boolean isAfterAdvice();

}
